﻿<%@ Page Title="Lý luận chính trị" Language="C#" MasterPageFile="~/Views/MasterPageViews.master"
    AutoEventWireup="true" CodeFile="TypeOfPoliticalTheories.aspx.cs" Inherits="Views_TypeOfPoliticalTheories" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="ContentHeader" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="ContentChange" ContentPlaceHolderID="ContentPlaceHolderChange" runat="Server">
    <h3 class="header-title">
        <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="lblHeader" runat="server"
            Text="Lý luận chính trị" Icon="ApplicationOsxCascade" />
    </h3>
    <div class="content-sub">
        <ext:Toolbar ID="ToolbarFunctions" runat="server">
            <Items>
                <ext:Button ID="btnToobarAdd" runat="server" Text="Thêm mới" Icon="Add" OnDirectClick="btnToobarAdd_DirectClick">
                    <Listeners>
                        <Click Handler="#{FormPanelAdd}.getForm().reset();" />
                    </Listeners>
                </ext:Button>
                <ext:Button ID="btnToobarUpdate" runat="server" Text="Chỉnh sửa" Icon="Pencil" OnDirectClick="btnToobarUpdate_DirectClick" />
                <ext:Button ID="btnToobarDelete" runat="server" Text="Xóa" Icon="Delete" OnDirectClick="btnToobarDelete_DirectClick" />
                <ext:Button ID="btnToobarHelp" runat="server" Text="Hỗ trợ" Icon="Help" />
            </Items>
        </ext:Toolbar>


        <ext:Store 
            ID="StorePoliticalTheories" 
            runat="server" 
            OnReadData="StorePoliticalTheories_ReadData"
            PageSize="30">
            <Sorters>
                <ext:DataSorter Direction="ASC" Property="NameOfPoli" />
            </Sorters>
            <Model>
                <ext:Model ID="ModelPoliticalTheories" runat="server" IDProperty="PoliID">
                    <Fields>
                        <ext:ModelField Name="PoliID" />
                        <ext:ModelField Name="NameOfPoli" />
                        <ext:ModelField Name="Descriptons" />
                        <ext:ModelField Name="StatusOfPoli" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
        <!--Content data-->
        <ext:GridPanel 
            ID="gridPanelPoliticalTheories" 
            runat="server" 
            StoreID="StorePoliticalTheories"
            Height="510" 
            Title="Danh sách lý luận chính trị" 
            BodyStyle="background-image: url('../Themes/bg-main.png')">
            <ColumnModel ID="ColumnModelSalaries" runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumnProvince" Width="30" Text="STT" runat="server" />
                    <ext:Column ID="Col_PoliID" runat="server" Text="ID" DataIndex="PoliID" Hidden="true" />
                    <ext:Column ID="Col_NameOfPoli" runat="server" Text="Tên lý luận chính trị" DataIndex="NameOfPoli" Flex="1" />
                    <ext:Column ID="Col_Descriptons" runat="server" Text="Mô tả" DataIndex="Descriptons" />
                    <ext:CheckColumn ID="Col_StatusOfPoli" runat="server" Text="Trạng thái" DataIndex="StatusOfPoli" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModelPoliticalTheories" runat="server" Mode="Single">
                    <DirectEvents>
                        <Select OnEvent="RowSelected" Buffer="250" />
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbarPoliticalTheories" runat="server" StoreID="StorePoliticalTheories"
                    AfterPageText="của {0}" BeforePageText="Trang" DisplayMsg="Hiển thị bản ghi {0} - {1} của {2}"
                    EmptyMsg="Chưa có dữ liệu" FirstText="Trang đầu tiên" LastText="Trang cuối cùng"
                    NextText="Trang kế tiếp" PrevText="Trang trước" RefreshText="Làm mới" />
            </BottomBar>
        </ext:GridPanel>
        <%--End content data--%>
    </div>



    <!-- Cửa sổ popup thêm  lý luân chính trị -->
    <ext:Window ID="windowAddPoliticalTheories" runat="server" Title="Thêm mới lý luận chính trị"
        Icon="Add" Width="360" Height="250" Modal="true" ShadowMode="Drop" Hidden="true" Collapsible="true"
        Resizable="false" BodyStyle="background-image: url('../Themes/bg-main.png')">
        <Content>
            <ext:FormPanel runat="server" ID="FormPanelAdd" Unstyled="True" Height="200">
                <Items>
                    <ext:Container runat="server">
                        <Items>
                            <ext:Toolbar ID="ToolbarAddPoliticalTheories" runat="server">
                                <Items>
                                    <ext:Button ID="btnAdd" runat="server" Text="Lưu lại" Icon="DiskBlack">
                                        <Listeners>
                                            <Click Handler="if(#{FormPanelAdd}.getForm().isValid()) {App.direct.AddPoliticalTheories_DirectClick();}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnAddCancel" runat="server" Text="Hủy bỏ" Icon="Delete">
                                        <Listeners>
                                            <Click Handler="#{windowAddPoliticalTheories}.close();" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                            <ext:Container runat="server" ID="container4" MarginSpec="10 5 10 5">
                                <Items>
                                    <ext:Label ID="lblFormAddMsg" runat="server" StyleSpec="color:red;font-weight:bold" />
                                </Items>
                            </ext:Container>
                            <ext:Container runat="server" ID="container2" MarginSpec="10 5 10 5">
                                <Items>
                                    <ext:TextField ID="txtFormAddNameOfPoli" runat="server" FieldLabel="Tên lý luận chính trị"
                                        Width="330" LabelWidth="120" BlankText="Tên lý luận không được để trống" AllowBlank="false" />
                                    <ext:TextArea ID="txtFormAddDescriptons" runat="server" FieldLabel="Mô tả" Width="330"
                                        LabelWidth="120" BlankText="Mô tả không được để trống" AllowBlank="false" />
                                    <ext:Checkbox ID="chkFormAddStatusOfPoli" runat="server" FieldLabel="Trạng thái"
                                        BoxLabel="Cho phép hoạt động" LabelWidth="120" />
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:FormPanel>
        </Content>
    </ext:Window>


    <!-- Cửa sổ popup Cập nhật lý luân chính trị -->
    <ext:Window
        ID="windowUpdatePoliticalTheories"
        runat="server"
        Title="Cập nhật lý luận chính trị"
        Icon="Add"
        Height="250"
        Width="360"
        Modal="true"
        ShadowMode="Drop"
        Hidden="true"
        Resizable="false" 
        BodyStyle="background-image: url('../Themes/bg-main.png')">
        <Content>
            <ext:FormPanel runat="server" ID="FormPanelUpdate" Unstyled="True" Height="200">
                <Items>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Button ID="Button1" runat="server" Text="Lưu lại" Icon="DiskBlack">
                                <Listeners>
                                    <Click Handler="if(#{FormPanelUpdate}.getForm().isValid()) {App.direct.UpdatePoliticalTheories_DirectClick();}" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button2" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnUpdateCancel_DirectClick" />
                        </Items>
                    </ext:Toolbar>
                    <ext:Container ID="Container3" runat="server" MarginSpec="10 5 10 5">
                        <Items>
                            <ext:Label ID="lblFormUpdateMsg" runat="server" StyleSpec="color:red;font-weight:bold" />
                        </Items>
                    </ext:Container>
                    <ext:Container ID="Container1" runat="server" MarginSpec="10 5 10 5">
                        <Items>
                            <ext:TextField ID="txtFormUpdateNameOfPoli" runat="server" FieldLabel="Tên lý luận chính trị"
                                Width="330" LabelWidth="120" BlankText="Tên lý luận không được để trống" AllowBlank="false" />
                            <ext:TextArea ID="txtFormUpdateDescriptons" runat="server" FieldLabel="Mô tả" Width="330"
                                LabelWidth="120" BlankText="Mô tả không được để trống" AllowBlank="false" />
                            <ext:Checkbox ID="chkFormUpdateStatusOfPoli" runat="server" FieldLabel="Trạng thái"
                                BoxLabel="Cho phép hoạt động" LabelWidth="120" />
                        </Items>
                    </ext:Container>
                </Items>
            </ext:FormPanel>
        </Content>
    </ext:Window>
    <div class="view-info-record">
        <h3 class="header-title">
            <ext:Label ID="lblHeaderViewInfomations" StyleHtmlCls="lable-message" StyleHtmlContent="true"
                runat="server" Text="Hiển thị thông tin" Icon="Information" />
        </h3>
        <div class="content-info">
            <table>
                <tr>
                    <td class="with-td-view-info">ID:
                    </td>
                    <td>
                        <ext:Label ID="lblViewPoliID" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Tên lý luận chính trị:
                    </td>
                    <td>
                        <ext:Label ID="lblViewNameOfPoli" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Mô tả:
                    </td>
                    <td>
                        <ext:Label ID="lblViewDescriptons" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Trạng thái:
                    </td>
                    <td>
                        <ext:Checkbox ID="chkViewStatusOfPoli" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
